function [norm_data_set, norm_params] = norm_data(data_set, norm_params)
%NORM_DATA Normalizes the given data set using to [-1,1] column wise
%          Params:
%               data_set - the data_set to normalize
%               norm_params - max and min value used for normalization of
%                             each attribute.
%          Output:
%               norm_data_set - normalized data set
%               norm_params - max and min value used for normalization of
%                             each attribute.
    if nargin < 2
        use_params = false;
    else
        use_params = true;
    end
    norm_data_set = zeros(size(data_set));
    m_size = size(data_set,2);
    

    if use_params==false
        norm_params = zeros(2,m_size);
    end
    
    for i = 1:m_size
        vec = data_set(:,i);
        if use_params==false
            norm_params(1,i) = max(vec);
            norm_params(2,i) = min(vec);
        end
        norm_data_set(:,i) = ((vec - norm_params(2,i))./ ...
                             (norm_params(1,i)-norm_params(2,i)) - 0.5 )*2;
    end
end

